import java.awt.Point;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.rsbot.script.methods.Calculations;
import org.rsbot.script.methods.Game;
import org.rsbot.script.methods.Interfaces;
import org.rsbot.script.methods.Objects;
import org.rsbot.script.methods.Skills;
import org.rsbot.script.util.Timer;
import org.rsbot.script.wrappers.RSArea;
import org.rsbot.script.wrappers.RSComponent;
import org.rsbot.script.wrappers.RSInterface;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.wrappers.RSPlayer;
import org.rsbot.script.wrappers.RSTile;

final class VoluntaryThieve$Actions$Methods
{
  private VoluntaryThieve$Actions$Methods(VoluntaryThieve.Actions paramActions)
  {
  }

  private boolean isLoggedIn()
  {
    return (VoluntaryThieve.access$600(this.this$1.this$0).isLoggedIn()) && (VoluntaryThieve.access$700(this.this$1.this$0).getRealLevel(17) > 1);
  }

  private int[] getTrainers()
  {
    int[] arrayOfInt1 = { 11281, 11283, 11285, VoluntaryThieve.Options.access$900(VoluntaryThieve.access$800(this.this$1.this$0)) ? new int[] { 11289, 11291, 11293, 11297 } : 11287 };

    ArrayList localArrayList = new ArrayList();
    int[] arrayOfInt2 = arrayOfInt1; int i = arrayOfInt2.length; for (int j = 0; j < i; j++) { Integer localInteger = Integer.valueOf(arrayOfInt2[j]);
      Boolean localBoolean = (Boolean)VoluntaryThieve.Actions.access$1000(this.this$1).get(localInteger);
      if ((localBoolean == null) || (localBoolean.booleanValue())) {
        localArrayList.add(localInteger);
      }
    }
    arrayOfInt2 = new int[localArrayList.size()];
    for (i = 0; i < localArrayList.size(); i++)
      arrayOfInt2[i] = ((Integer)localArrayList.get(i)).intValue();
    return arrayOfInt2;
  }

  private boolean isDoorOpen()
  {
    RSObject localRSObject = getOpenDoor();
    return (localRSObject != null) && (localRSObject.getID() == 52315);
  }

  private RSObject getOpenDoor()
  {
    return VoluntaryThieve.access$1200(this.this$1.this$0).getTopAt(new RSTile(4755 + VoluntaryThieve.Actions.access$1100(this.this$1).x, 5795 + VoluntaryThieve.Actions.access$1100(this.this$1).y));
  }

  private RSObject getClosedDoor()
  {
    return VoluntaryThieve.access$1300(this.this$1.this$0).getTopAt(new RSTile(4754 + VoluntaryThieve.Actions.access$1100(this.this$1).x, 5795 + VoluntaryThieve.Actions.access$1100(this.this$1).y));
  }

  private boolean isLureScreenValid()
  {
    if (hasKnockoutFailed()) return false;
    int[] arrayOfInt1 = { 64, 241 };
    for (int k : arrayOfInt1) {
      RSInterface localRSInterface = VoluntaryThieve.access$1400(this.this$1.this$0).get(k);
      if ((localRSInterface != null) && (localRSInterface.isValid())) {
        return true;
      }
    }
    return false;
  }

  private boolean hasKnockoutFailed()
  {
    RSInterface localRSInterface = VoluntaryThieve.access$1500(this.this$1.this$0).get(64);
    return (localRSInterface != null) && (localRSInterface.isValid()) && (localRSInterface.getComponent(4).containsText("divert"));
  }

  private boolean isStunned()
  {
    return (VoluntaryThieve.Actions.access$1600(this.this$1) != null) && (VoluntaryThieve.Actions.access$1600(this.this$1).isRunning());
  }

  private VoluntaryThieve.Action getDoorAction()
  {
    RSObject localRSObject = VoluntaryThieve.Actions.access$1700(this.this$1).getClosedDoor();
    return (localRSObject != null) && (VoluntaryThieve.access$1800(this.this$1.this$0).distanceTo(localRSObject.getLocation()) < 5) ? VoluntaryThieve.Actions.access$1900(this.this$1, 8, new Object[0]) : VoluntaryThieve.Actions.access$1900(this.this$1, 9, new Object[0]);
  }

  private boolean isInBank()
  {
    return new RSArea(new RSTile(4747 + VoluntaryThieve.Actions.access$1100(this.this$1).x, 5793 + VoluntaryThieve.Actions.access$1100(this.this$1).y), new RSTile(4754 + VoluntaryThieve.Actions.access$1100(this.this$1).x, 5797 + VoluntaryThieve.Actions.access$1100(this.this$1).y)).contains(new RSTile[] { this.this$1.this$0.getMyPlayer().getLocation() });
  }

  private boolean isInGuild()
  {
    return (new RSArea(new RSTile(4745 + VoluntaryThieve.Actions.access$1100(this.this$1).x, 5762 + VoluntaryThieve.Actions.access$1100(this.this$1).y), new RSTile(4794 + VoluntaryThieve.Actions.access$1100(this.this$1).x, 5806 + VoluntaryThieve.Actions.access$1100(this.this$1).y)).contains(new RSTile[] { this.this$1.this$0.getMyPlayer().getLocation() })) && (VoluntaryThieve.access$2000(this.this$1.this$0).getPlane() == 0);
  }

  private Point getOffset()
  {
    RSTile localRSTile = this.this$1.this$0.getMyPlayer().getLocation();
    Point localPoint = new Point();

    if ((4617 <= localRSTile.getX()) && (localRSTile.getX() <= 4666)) {
      localPoint.x = -128;
    }
    if ((5890 <= localRSTile.getY()) && (localRSTile.getY() <= 5934)) {
      localPoint.y = 128;
    }
    return localPoint;
  }
}